﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using TTQT;
using TTQT.TTQT_Code;
using MyWebUtils;

public partial class NoiDungThongBao : MasterControl //System.Web.UI.UserControl
{

    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            try{
			
				ds.SelectCommandType = SqlDataSourceCommandType.StoredProcedure;
	            ds.SelectCommand = "ThongBaoToanNganh_get";
	            DataView hehe = (DataView)ds.Select(System.Web.UI.DataSourceSelectArguments.Empty);
				
	            if (hehe.ToTable().Rows[0][1].ToString().ToLower().Equals("true"))
	            {
	                lblThongBao.Text = string.Empty;
	                lblThongBao.Visible = false;
	                return;
	            }
	            lblThongBao.Text = @"<div class='ThongBaoToanNganh'>";
	            //lblThongBao.Text+="<marquee behavior='alternate' onmouseover='this.stop();' onmouseout='this.start();'>";
	            lblThongBao.Text += hehe.ToTable().Rows[0][0].ToString();
	            //lblThongBao.Text += "</marquee>";
	            lblThongBao.Text += "</div>";
			}catch(Exception ex){
				lblThongBao.Text = @"<div class='ThongBaoToanNganh'>";
	            //lblThongBao.Text+="<marquee behavior='alternate' onmouseover='this.stop();' onmouseout='this.start();'>";
	            lblThongBao.Text += "<span style='color:red;font-weight:bold;'>Hệ thống đang tạm ngừng để bảo trì. Bạn vui lòng quay lại sau ít phút nữa! Xin cảm ơn!</span>";
	            //lblThongBao.Text += "</marquee>";
	            lblThongBao.Text += "</div>";
			}
           
        }
    }
}
